package com.icss.dao;

import com.icss.entity.Dept;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class DeptFileDao implements IDeptFileDao {

  public static final File FILE_DEPT_PATH = new File("src/com/icss/storge/deptFile.txt");


    @Override
    public void writeDept(Dept dept) {
        try {
            FileWriter fileWriter = new FileWriter(FILE_DEPT_PATH, true);
            fileWriter.write(dept.getDeptNo() + "," + dept.getDepName() + "," + dept.getDepAddress()+"\n");
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
